# uncompyle6 version 3.2.3
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.8 |Anaconda custom (64-bit)| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: db\views\locations_extended.py
__author__ = "sanyi"
from sqlalchemy import *
from sqlalchemy.orm import mapper
from sqlalchemy.dialects.postgresql import UUID as C_UUID
from sqlalchemy.dialects.postgresql import ARRAY as C_ARRAY
from db.tables import metadata
from db.tables.locations import LocationType

LocationsExtendedViewTable = Table(
    "locations_extended",
    metadata,
    Column("loc_id", INTEGER, nullable=False, primary_key=True),
    Column(
        "scan_session_id",
        C_UUID,
        ForeignKey("scan_sessions.scan_session_id", ondelete="CASCADE"),
        nullable=False,
        primary_key=True,
        index=True,
    ),
    Column("name", TEXT, nullable=False),
    Column("parent_id", INTEGER, index=True),
    Column("source_id", INTEGER, index=True),
    Column("root_id", INTEGER, index=True),
    Column("tags", C_ARRAY(TEXT), index=True),
    Column("path", TEXT),
    Column("loc_type", LocationType),
    Column("vuln_info", INTEGER),
    Column("vuln_low", INTEGER),
    Column("vuln_medium", INTEGER),
    Column("vuln_high", INTEGER),
)


class LocationExtendedViewRow(object):
    loc_id = None
    parent_id = None
    scan_session_id = None
    tags = None
    root_id = None
    path = None
    loc_type = None

    def __str__(self):
        return "R_location_extended_view:%s:%s" % (self.scan_session_id, self.loc_id)

    def __repr__(self):
        return self.__str__()


mapper(LocationExtendedViewRow, LocationsExtendedViewTable)
